import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', {
  state: () => ({
    username: 'Anonymous',
    isAuthenticated: false
  }),
  actions: {
    login(username) {
      this.username = username
      this.isAuthenticated = true
    },
    logout() {
      this.username = 'Anonymous'
      this.isAuthenticated = false
    }
  }
})
